import { CustomFlow } from "src/custom-flow/entities/custom-flow.entity";
import Dept from "src/dept/entities/dept.entity";
import { Column, CreateDateColumn, Entity, JoinColumn, ManyToOne, OneToOne, PrimaryGeneratedColumn, UpdateDateColumn } from "typeorm";

@Entity()
export default class Matter {
  @PrimaryGeneratedColumn("uuid")
  id: string;

  @Column()
  matterName: string;

  @Column()
  deptId: string;

  @ManyToOne(() => Dept, dept => dept.matters)
  dept: Dept

  @Column()
  customFlowId: string;

  @OneToOne(() => CustomFlow)
  @JoinColumn()
  customFlow: CustomFlow

  @CreateDateColumn()
  createdDate: Date;

  @UpdateDateColumn()
  updatedDate: Date;
}